﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Configuration;

namespace WebApplication1
{
    public partial class addpub : System.Web.UI.Page
    {
        SqlConnection cnn = new SqlConnection(WebConfigurationManager.AppSettings["connect"]);
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void regbtn_Click(object sender, EventArgs e)
        {
            cnn.Open();
            SqlCommand cmd = new SqlCommand("insert into pub values('" + txtpbno.Text + "','" + txtpbname.Text + "','" + txtaddr.Text + "','" + txtmail.Text + "','" + txtdesc.Text + "')", cnn);
            cmd.ExecuteNonQuery();
            cnn.Close();
            Response.Redirect("~/Admin/default1.aspx");
        }
    }
}